package resp

import (
	"github.com/gin-gonic/gin"
	"github.com/golang/protobuf/proto"
	"net/http"
)

func PbRespOk(c *gin.Context, args ...proto.Message) {
	var data proto.Message
	if len(args) != 0 {
		data = args[0]
	}
	respByte, _ := proto.Marshal(data)
	_, _ = c.Writer.Write(respByte)
	return
}

func PbRespErr(c *gin.Context) {
	c.Status(http.StatusBadRequest)
	return
}
